package ar.uade.distribuidas.tpo.srv.servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ar.uade.distribuidas.tpo.srv.delegado.BD;

/**
 * Servlet implementation class BuscarProveedor
 */
@WebServlet("/BuscarProveedor")
public class BuscarProveedor extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public BuscarProveedor() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String cuil = request.getParameter("cuilb");
		request.setAttribute("cuilb", BD.getInstance().getProveedor(Long.valueOf(cuil)).getCuil());
	    RequestDispatcher dispatcher = request.getRequestDispatcher("jsp/modificarproveedor.jsp");
	   
	    dispatcher.forward(request, response);	
	    
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
